.class Lcom/nemustech/regina/ReginaCheckForUpdate$4$1;
.super Ljava/lang/Object;
.source "ReginaCheckForUpdate.java"

# interfaces
.implements Landroid/content/DialogInterface$OnClickListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/nemustech/regina/ReginaCheckForUpdate$4;->onClick(Landroid/view/View;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$1:Lcom/nemustech/regina/ReginaCheckForUpdate$4;


# direct methods
.method constructor <init>(Lcom/nemustech/regina/ReginaCheckForUpdate$4;)V
    .locals 0
    .parameter

    .prologue
    .line 129
    iput-object p1, p0, Lcom/nemustech/regina/ReginaCheckForUpdate$4$1;->this$1:Lcom/nemustech/regina/ReginaCheckForUpdate$4;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onClick(Landroid/content/DialogInterface;I)V
    .locals 8
    .parameter "arg0"
    .parameter "arg1"

    .prologue
    const/4 v7, 0x1

    .line 133
    iget-object v4, p0, Lcom/nemustech/regina/ReginaCheckForUpdate$4$1;->this$1:Lcom/nemustech/regina/ReginaCheckForUpdate$4;

    iget-object v4, v4, Lcom/nemustech/regina/ReginaCheckForUpdate$4;->this$0:Lcom/nemustech/regina/ReginaCheckForUpdate;

    invoke-static {v4}, Lcom/nemustech/regina/ReginaCheckForUpdate;->access$200(Lcom/nemustech/regina/ReginaCheckForUpdate;)Z

    move-result v4

    if-nez v4, :cond_2

    .line 134
    iget-object v4, p0, Lcom/nemustech/regina/ReginaCheckForUpdate$4$1;->this$1:Lcom/nemustech/regina/ReginaCheckForUpdate$4;

    iget-object v4, v4, Lcom/nemustech/regina/ReginaCheckForUpdate$4;->this$0:Lcom/nemustech/regina/ReginaCheckForUpdate;

    invoke-static {v4, v7}, Lcom/nemustech/regina/ReginaCheckForUpdate;->access$202(Lcom/nemustech/regina/ReginaCheckForUpdate;Z)Z

    .line 136
    new-instance v3, Ljava/util/ArrayList;

    invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V

    .line 137
    .local v3, updateList:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/nemustech/regina/XMLRecord;>;"
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    iget-object v4, p0, Lcom/nemustech/regina/ReginaCheckForUpdate$4$1;->this$1:Lcom/nemustech/regina/ReginaCheckForUpdate$4;

    iget-object v4, v4, Lcom/nemustech/regina/ReginaCheckForUpdate$4;->this$0:Lcom/nemustech/regina/ReginaCheckForUpdate;

    invoke-static {v4}, Lcom/nemustech/regina/ReginaCheckForUpdate;->access$400(Lcom/nemustech/regina/ReginaCheckForUpdate;)Ljava/util/ArrayList;

    move-result-object v4

    invoke-virtual {v4}, Ljava/util/ArrayList;->size()I

    move-result v4

    if-ge v0, v4, :cond_1

    .line 138
    iget-object v4, p0, Lcom/nemustech/regina/ReginaCheckForUpdate$4$1;->this$1:Lcom/nemustech/regina/ReginaCheckForUpdate$4;

    iget-object v4, v4, Lcom/nemustech/regina/ReginaCheckForUpdate$4;->this$0:Lcom/nemustech/regina/ReginaCheckForUpdate;

    invoke-static {v4}, Lcom/nemustech/regina/ReginaCheckForUpdate;->access$400(Lcom/nemustech/regina/ReginaCheckForUpdate;)Ljava/util/ArrayList;

    move-result-object v4

    invoke-virtual {v4, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/nemustech/regina/XMLRecord;

    .line 139
    .local v1, record:Lcom/nemustech/regina/XMLRecord;
    invoke-virtual {v1}, Lcom/nemustech/regina/XMLRecord;->canUpdated()Z

    move-result v4

    if-eqz v4, :cond_0

    .line 140
    invoke-virtual {v3, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 141
    const-string v4, "ReginaCheckForUpdate"

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v1}, Lcom/nemustech/regina/XMLRecord;->getAppName()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, " will be updated"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    iget-object v6, p0, Lcom/nemustech/regina/ReginaCheckForUpdate$4$1;->this$1:Lcom/nemustech/regina/ReginaCheckForUpdate$4;

    iget-object v6, v6, Lcom/nemustech/regina/ReginaCheckForUpdate$4;->this$0:Lcom/nemustech/regina/ReginaCheckForUpdate;

    invoke-static {v6}, Lcom/nemustech/regina/ReginaCheckForUpdate;->access$100(Lcom/nemustech/regina/ReginaCheckForUpdate;)Z

    move-result v6

    invoke-static {v4, v5, v6}, Lcom/nemustech/regina/RLog;->d(Ljava/lang/String;Ljava/lang/String;Z)I

    .line 142
    invoke-virtual {v1, v7}, Lcom/nemustech/regina/XMLRecord;->setTargeted(Z)V

    .line 137
    :cond_0
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 145
    .end local v1           #record:Lcom/nemustech/regina/XMLRecord;
    :cond_1
    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v4

    if-lez v4, :cond_2

    .line 146
    iget-object v4, p0, Lcom/nemustech/regina/ReginaCheckForUpdate$4$1;->this$1:Lcom/nemustech/regina/ReginaCheckForUpdate$4;

    iget-object v4, v4, Lcom/nemustech/regina/ReginaCheckForUpdate$4;->this$0:Lcom/nemustech/regina/ReginaCheckForUpdate;

    invoke-virtual {v4}, Lcom/nemustech/regina/ReginaCheckForUpdate;->isMediaMounted()Z

    move-result v4

    if-eqz v4, :cond_3

    .line 147
    new-instance v2, Lcom/nemustech/regina/UpdaterTask;

    iget-object v4, p0, Lcom/nemustech/regina/ReginaCheckForUpdate$4$1;->this$1:Lcom/nemustech/regina/ReginaCheckForUpdate$4;

    iget-object v4, v4, Lcom/nemustech/regina/ReginaCheckForUpdate$4;->this$0:Lcom/nemustech/regina/ReginaCheckForUpdate;

    invoke-direct {v2, v3, v4}, Lcom/nemustech/regina/UpdaterTask;-><init>(Ljava/util/ArrayList;Landroid/app/Activity;)V

    .line 148
    .local v2, task:Lcom/nemustech/regina/UpdaterTask;
    const/4 v4, 0x0

    new-array v4, v4, [Ljava/lang/Void;

    invoke-virtual {v2, v4}, Lcom/nemustech/regina/UpdaterTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    .line 154
    .end local v0           #i:I
    .end local v2           #task:Lcom/nemustech/regina/UpdaterTask;
    .end local v3           #updateList:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/nemustech/regina/XMLRecord;>;"
    :cond_2
    :goto_1
    return-void

    .line 150
    .restart local v0       #i:I
    .restart local v3       #updateList:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/nemustech/regina/XMLRecord;>;"
    :cond_3
    iget-object v4, p0, Lcom/nemustech/regina/ReginaCheckForUpdate$4$1;->this$1:Lcom/nemustech/regina/ReginaCheckForUpdate$4;

    iget-object v4, v4, Lcom/nemustech/regina/ReginaCheckForUpdate$4;->this$0:Lcom/nemustech/regina/ReginaCheckForUpdate;

    iget-object v5, p0, Lcom/nemustech/regina/ReginaCheckForUpdate$4$1;->this$1:Lcom/nemustech/regina/ReginaCheckForUpdate$4;

    iget-object v5, v5, Lcom/nemustech/regina/ReginaCheckForUpdate$4;->this$0:Lcom/nemustech/regina/ReginaCheckForUpdate;

    const v6, 0x7f070074

    invoke-virtual {v5, v6}, Lcom/nemustech/regina/ReginaCheckForUpdate;->getString(I)Ljava/lang/String;

    move-result-object v5

    invoke-static {v4, v5}, Lcom/nemustech/regina/RUtils;->showToast(Landroid/content/Context;Ljava/lang/String;)Landroid/widget/Toast;

    goto :goto_1
.end method
